* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
    transition: background-color 0.3s ease;
}

.game-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #333;
    margin-bottom: 15px;
}

.theme-switcher,
.difficulty-selector {
    margin-bottom: 15px;
}

select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #45a049;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: #999;
    padding: 1px;
    margin-bottom: 20px;
}

.cell {
    aspect-ratio: 1;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cell:hover {
    background-color: #f0f0f0;
}

.cell.fixed {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.cell.selected {
    background-color: #e3f2fd;
}

.cell.error {
    background-color: #ffebee;
}

.cell.highlight-same {
    background-color: #fff3e0;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-top: 20px;
}

.number {
    padding: 15px;
    font-size: 1.2em;
}

/* 主题样式 */
[data-theme="dark"] {
    background-color: #1a1a1a;
}

[data-theme="dark"] .game-container {
    background-color: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] h1 {
    color: #fff;
}

[data-theme="dark"] .cell {
    background-color: #3d3d3d;
    color: #fff;
    border: 1px solid #555;
}

[data-theme="dark"] .cell:hover {
    background-color: #4d4d4d;
}

[data-theme="dark"] .cell.fixed {
    background-color: #2d2d2d;
}

[data-theme="dark"] .cell.selected {
    background-color: #1e88e5;
    box-shadow: 0 0 5px rgba(30, 136, 229, 0.5);
}

[data-theme="dark"] .cell.highlight-same {
    background-color: #ff9800;
    box-shadow: 0 0 5px rgba(255, 152, 0, 0.5);
}

[data-theme="dark"] .cell.error {
    background-color: #d32f2f;
    box-shadow: 0 0 5px rgba(211, 47, 47, 0.5);
}
[data-theme="colorful"] .game-container {
    background: linear-gradient(135deg, #fff6e5, #ffd6d6);
}

[data-theme="colorful"] .cell {
    border: 1px solid #ffb6c1;
}

[data-theme="colorful"] .cell.selected {
    background-color: #ffe4e1;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-container {
        margin: 10px;
        padding: 10px;
    }

    .number-pad {
        grid-template-columns: repeat(5, 1fr);
    }

    .cell {
        font-size: 1em;
    }
}

/* 动画效果 */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.highlight {
    animation: highlight 0.3s ease;
}
